package im

import (
	"context"
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/net/ghttp"
	v1 "go-websocket/api/im/v1"
	"go-websocket/internal/service"
	"go-websocket/utility"
)

type vendorCtl struct {

}


var Vendor = new(vendorCtl)


func (c *vendorCtl) GetMemberPhotos (r *ghttp.Request) {

	var req *v1.GetMemberPhotosReq

	if err := r.Parse(&req);err != nil {
		g.Log().Error(context.TODO(), err)
		//返回错误信息
		r.Response.WriteExit(utility.JsonResult{
			Err: 1,
			Msg: err.Error(),
		})
	}

	lists, err := service.Vendor.GetMemberPhotos(req)

	if err != nil {
		g.Log().Error(context.TODO(), err)
		//返回错误信息
		r.Response.WriteExit(utility.JsonResult{
			Err: 1,
			Msg: err.Error(),
		})
	}
	r.Response.WriteExit(utility.JsonResult{
		Err: 0,
		Msg: "",
		Data: lists,
	})

}